using System;
class Program
{
    public static void Main()
    {
        IIndex<Rectangle> rectangles = RectangleCollection.GetRectangleCollection();
        IIndex<Shape> shapes = RectangleCollection.GetRectangleCollection();
        for (int i = 0; i < shapes.Count; i++)
        {
            Console.WriteLine(shapes[i]);
        }

        Console.WriteLine(".............................");

        IDisplay<Shape> shapeDisplay = new ShapeDisplay();
        IDisplay<Rectangle> rectangleDisplay = shapeDisplay;
        rectangleDisplay.Show(rectangles[0]);
        shapeDisplay.Show(rectangles[0]);
    }
}